using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Domains
{
    /// <summary>
    /// <para>Alter Domain</para>
    /// <para>Alters the properties of an existing attribute domain in a workspace.</para>
    /// <para>更改工作区中现有属性域的属性。</para>
    /// </summary>    
    [DisplayName("Alter Domain")]
    public class AlterDomain : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AlterDomain()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para>The geodatabase that contains the domain to be altered.</para>
        /// <para>包含要更改的属性域的地理数据库。</para>
        /// </param>
        /// <param name="_domain_name">
        /// <para>Domain Name</para>
        /// <para>The name of the domain to be altered.</para>
        /// <para>要更改的域的名称。</para>
        /// </param>
        public AlterDomain(object _in_workspace, object _domain_name)
        {
            this._in_workspace = _in_workspace;
            this._domain_name = _domain_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Alter Domain";

        public override string CallName => "management.AlterDomain";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_workspace, _domain_name, _new_domain_name, _new_domain_description, _split_policy.GetGPValue(), _merge_policy.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>The geodatabase that contains the domain to be altered.</para>
        /// <para>包含要更改的属性域的地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Domain Name</para>
        /// <para>The name of the domain to be altered.</para>
        /// <para>要更改的域的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _domain_name { get; set; }


        /// <summary>
        /// <para>New Domain Name</para>
        /// <para>The new name of the domain.</para>
        /// <para>域的新名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("New Domain Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _new_domain_name { get; set; } = null;


        /// <summary>
        /// <para>New Domain Description</para>
        /// <para>The new description of the domain.</para>
        /// <para>域的新描述。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("New Domain Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _new_domain_description { get; set; } = null;


        /// <summary>
        /// <para>New Split Policy</para>
        /// <para><xdoc>
        ///   <para>The split policy of the domain. The behavior of an attribute's values when a feature that is split is controlled by its split policy.</para>
        ///   <bulletList>
        ///     <bullet_item>Use the attribute's default value—The attributes of the two resulting features take on the default value of the attribute of the given feature class or subtype.</bullet_item><para/>
        ///     <bullet_item>Duplicate attribute values—The attribute of the two resulting features takes on a copy of the original object's attribute value.</bullet_item><para/>
        ///     <bullet_item>Use geometric ratio—The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, each new feature's attribute gets one-half the value of the original object's attribute. The geometry ratio policy only applies to range domains.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>域的拆分策略。当分割的要素受其分割策略控制时，属性值的行为。</para>
        ///   <bulletList>
        ///     <bullet_item>使用属性的默认值 - 两个生成要素的属性采用给定要素类或子类型的属性的默认值。</bullet_item><para/>
        ///     <bullet_item>重复属性值 - 生成的两个要素的属性将采用原始对象属性值的副本。</bullet_item><para/>
        ///     <bullet_item>使用几何比率 - 生成要素的属性是原始要素值的比率。该比率基于将原始几何图形划分为的比例。如果几何被平均划分，则每个新要素的属性将获得原始对象属性值的一半。几何比率策略仅适用于范围域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("New Split Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _split_policy_value _split_policy { get; set; } = _split_policy_value._DEFAULT;

        public enum _split_policy_value
        {
            /// <summary>
            /// <para>Use the attribute's default value</para>
            /// <para>Use the attribute's default value—The attributes of the two resulting features take on the default value of the attribute of the given feature class or subtype.</para>
            /// <para>使用属性的默认值 - 两个生成要素的属性采用给定要素类或子类型的属性的默认值。</para>
            /// </summary>
            [Description("Use the attribute's default value")]
            [GPEnumValue("DEFAULT")]
            _DEFAULT,

            /// <summary>
            /// <para>Duplicate attribute values</para>
            /// <para>Duplicate attribute values—The attribute of the two resulting features takes on a copy of the original object's attribute value.</para>
            /// <para>重复属性值 - 生成的两个要素的属性将采用原始对象属性值的副本。</para>
            /// </summary>
            [Description("Duplicate attribute values")]
            [GPEnumValue("DUPLICATE")]
            _DUPLICATE,

            /// <summary>
            /// <para>Use geometric ratio</para>
            /// <para>Use geometric ratio—The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, each new feature's attribute gets one-half the value of the original object's attribute. The geometry ratio policy only applies to range domains.</para>
            /// <para>使用几何比率 - 生成要素的属性是原始要素值的比率。该比率基于将原始几何图形划分为的比例。如果几何被平均划分，则每个新要素的属性将获得原始对象属性值的一半。几何比率策略仅适用于范围域。</para>
            /// </summary>
            [Description("Use geometric ratio")]
            [GPEnumValue("GEOMETRY_RATIO")]
            _GEOMETRY_RATIO,

        }

        /// <summary>
        /// <para>New Merge Policy</para>
        /// <para><xdoc>
        ///   <para>The merge policy of the domain. When two features are merged into a single feature, merge policies control attribute values in the new feature. Altering this property applies only to range domains, as coded value domains may only use the default merge policy.</para>
        ///   <bulletList>
        ///     <bullet_item>Use the attribute's default value—The attribute of the resulting feature takes on the default value of the attribute of the given feature class or subtype. This is the only merge policy that applies to nonnumeric fields and coded value domains.</bullet_item><para/>
        ///     <bullet_item>Sum of the values—The attribute of the resulting feature takes on the sum of the values from the original feature's attribute. The sum values policy only applies to range domains.</bullet_item><para/>
        ///     <bullet_item>Area weighted average—The attribute of the resulting feature is the weighted average of the attribute values of the original features. This average is based on the original feature's geometry. The area weighted policy only applies to range domains.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>域的合并策略。当两个要素合并为一个要素时，合并策略将控制新要素中的属性值。更改此属性仅适用于范围属性域，因为编码值属性域只能使用默认合并策略。</para>
        ///   <bulletList>
        ///     <bullet_item>使用属性的默认值 - 生成要素的属性采用给定要素类或子类型的属性的默认值。这是适用于非数值字段和编码值属性域的唯一合并策略。</bullet_item><para/>
        ///     <bullet_item>值之和 - 生成要素的属性采用原始要素属性的值之和。总和值策略仅适用于范围域。</bullet_item><para/>
        ///     <bullet_item>面积加权平均 - 生成要素的属性是原始要素属性值的加权平均值。此平均值基于原始要素的几何。区域加权策略仅适用于范围域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("New Merge Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _merge_policy_value _merge_policy { get; set; } = _merge_policy_value._DEFAULT;

        public enum _merge_policy_value
        {
            /// <summary>
            /// <para>Use the attribute's default value</para>
            /// <para>Use the attribute's default value—The attribute of the resulting feature takes on the default value of the attribute of the given feature class or subtype. This is the only merge policy that applies to nonnumeric fields and coded value domains.</para>
            /// <para>使用属性的默认值 - 生成要素的属性采用给定要素类或子类型的属性的默认值。这是适用于非数值字段和编码值属性域的唯一合并策略。</para>
            /// </summary>
            [Description("Use the attribute's default value")]
            [GPEnumValue("DEFAULT")]
            _DEFAULT,

            /// <summary>
            /// <para>Sum of the values</para>
            /// <para>Sum of the values—The attribute of the resulting feature takes on the sum of the values from the original feature's attribute. The sum values policy only applies to range domains.</para>
            /// <para>值之和 - 生成要素的属性采用原始要素属性的值之和。总和值策略仅适用于范围域。</para>
            /// </summary>
            [Description("Sum of the values")]
            [GPEnumValue("SUM_VALUES")]
            _SUM_VALUES,

            /// <summary>
            /// <para>Area weighted average</para>
            /// <para>Area weighted average—The attribute of the resulting feature is the weighted average of the attribute values of the original features. This average is based on the original feature's geometry. The area weighted policy only applies to range domains.</para>
            /// <para>面积加权平均 - 生成要素的属性是原始要素属性值的加权平均值。此平均值基于原始要素的几何。区域加权策略仅适用于范围域。</para>
            /// </summary>
            [Description("Area weighted average")]
            [GPEnumValue("AREA_WEIGHTED")]
            _AREA_WEIGHTED,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public AlterDomain SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}